/*User program on Nachos
  For project 4
*/

/*Author: Yuzhe Wu 4/14*/


#include "syscall.h"
#include "user.h"
#include "create.h"
#include "doctorOffice.h"

void main() {

	int xrayRoomNumLocal;
	int i = 0;
	myMV xrayRoomNum = -1;
	
	Printf("Please enter the number of Xray Technicians/Rooms(1 to 2)\n");
	xrayRoomNumLocal = InputInt();
	while ( !(xrayRoomNumLocal>=1&&xrayRoomNumLocal<=2)){ 
		Printf("You must input an Integer(1 to 2)\n");
		Printf("Please reenter the number of Examination Rooms(1 to 2)\n");
		xrayRoomNumLocal = InputInt();			
	}
	
	xrayRoomNum = rpcCreateMV("XRNum",sizeof("XRNum"),1,0);
	rpcSetValueMV(xrayRoomNum,0,xrayRoomNumLocal);
	
	for(i=0; i < xrayRoomNumLocal; i++){
		Exec("../test/xray",sizeof("../test/xray"));
		delay();
	}
	Exit(0);

}